Hệ thống bổ nhiệm bác sĩ trong PHP bằng mã nguồn

1 <?php session_start(); ?>
2
3 <!DOCTYPE html>
4 <html>
5 <head>
6     <meta charset=
"utf-8">
7     <meta http-equiv=
"X-UA-Compatible" content="IE=edge">
8     <title>medical management system</title>
9     <link rel=
"stylesheet" href="css/bootstrap.min.css">
10     <link rel=
"stylesheet" href="style.css">
11     <style>
12         .error {color: #FF0000;}
13     </style>
14 </head>
15 <body>
16
17
18
19     <div
class="container">
20         <div
class="header_top">
21             <span style=
"font-size:50px;color:#2c2f84;font-weight:bolder;margin-left:15px;">Doctor Appoinment System</span>
22         </div>
23
24     <!--
this is for menu -->
25     <div
class="navbar navbar-default nav">
26         <nav
class="menu">
27             <ul>
28                 <li><a href=
"../index.php">Home</a></li>
29                 
30                 <li><a href=
"logout.php">Logout</a></li>
31             </ul>
32         </nav>
33     </div>
34     
35
36
37
38
39
40
41     <!--
this is for donor registraton -->
42     <div
class="login">
43         <!-- <h1
class="text-center" style="background-color:;color: #fff;">Admin Panel</h1> -->
44             <div
class="formstyle" style="padding: 10px;border: 1px solid lightgrey;margin-right: 376px;margin-left: 406px; margin-bottom: 25px;background-color:black;">
45                 <form action=
"" method="post" class="text-center">
46                     <label>
47                         <input type=
"text" name="username" placeholder="username" required style="margin-right: 75px;">
48                     </label><br><br>
49                     <label>
50                         <input type=
"password" name="password" placeholder="password" required style="margin-right: 75px;">
51                     </label><br><br>
52                     <button name=
"submit" type="submit" style="margin-top:3px;padding:3px 25px; border-radius:4px;float:right;margin-right:75px;">Login</button> <br>
53
54                     
55
56                     <!-- login validation -->
57             <?php
58                             $_SESSION[
'adminstatus']="";
59                             include(
'../config.php');
60                             
if(isset($_POST["submit"])){
61
62                             $sql=
"SELECT * FROM users WHERE username= '" . $_POST["username"]."' AND password= '" . $_POST["password"]."'";
63
64                             $result = $conn->query($sql);
65
66                                     
if ($result->num_rows > 0) {
67                                             $_SESSION[
"username"]= $_POST["username"];
68                                             
69                                             $_SESSION[
'adminstatus']= "yes";
70                                             echo
"<script>location.replace('viewDoctor.php');</script>";
71                                                 
// echo "u are supposed to redirect to ur profile";
72                                         }
else {
73                                             echo
"<span style='color:red;'>Invalid username or password</span>";
74                                         }
75                         $conn->close();
76                     }
77                     
78             ?>
79         <!-- login validation End-->
80
81
82                 </form> <br>&nbsp;&nbsp;&nbsp;
83                 
84                 <br>
85
86                 
87         
88                 
89             
90         
91     </div>
92     
93     
94 </div>
95     
96 <?php include(
'footer.php'); ?>
97
98     
99     </div><!-- containerFluid Ends -->
100
101
102
103
104     <script src=
"js/bootstrap.min.js"></script>
105
106
107  
108             
109
110
111
112     
113 </body>
114 </html>


Gõ tìm kiếm nhanh...